﻿#include "DialogSelectAttachmentPointPath.h"
#include "ui_DialogSelectAttachmentPointPath.h"
#include "IdaWidgetHelper.h"

namespace pst
{
    DialogSelectAttachmentPointPath::DialogSelectAttachmentPointPath(QWidget* parent)
        : IdaDialogFrame(parent)
        , ui(new Ui::DialogSelectAttachmentPointPath())
    {
        ui->setupUi(this);

        setWindowTitle(QStringLiteral("选择附着点路径"));
        IdaWidgetHelperInstance->setMainButtonStyle(ui->pushButton_confirm); // 将确定设置为主按钮
    }

    DialogSelectAttachmentPointPath::~DialogSelectAttachmentPointPath()
    {
        delete ui;
    }

    void DialogSelectAttachmentPointPath::setFilePaths(const QList<QString>& paths)
    {
        ui->comboBox_file->clear();
        ui->comboBox_file->addItems(paths);
    }

    void DialogSelectAttachmentPointPath::on_pushButton_confirm_clicked()
    {
        emit signal_selectedAttachmentPointPathIndex(ui->comboBox_file->currentIndex());
        this->close();
    }

    void DialogSelectAttachmentPointPath::on_pushButton_cancel_clicked()
    {
        this->close();
    }
}
